package com.easa.service;

import com.easa.bean.CurrentWeek;
import com.easa.dao.WeektableDao;
import com.easa.entity.Semester;
import com.easa.entity.Weektable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class WeektableServiceImpl implements WeektableService{

    @Autowired
    private WeektableDao weektableDao;

    public Weektable findWeekidByNow(Date today){
        return weektableDao.findWeekidByNow(today);
    }

    public String findSemesterName(String semester){
        return weektableDao.findSemesterName(semester);
    }

    public List<Semester> findSemester(){
        return weektableDao.findSemester();
    }

    public CurrentWeek findCurrentWeek(){
        return weektableDao.findCurrentWeek();
    }

    public String findSemesterId(String semesterName){
        return weektableDao.findSemesterId(semesterName);
    }
    public Weektable findWeekidBydateStr(String searchDate){
        return weektableDao.findWeekidBydateStr(searchDate);
    }
    public Weektable findWeekById(String weekid){
        return weektableDao.findWeekById(weekid);
    }

    public Semester getSemesterById(String semesterId){
        return weektableDao.getSemesterById(semesterId);
    }

    public List<Weektable> findWeekBySemesterId(String semesterId){
        return weektableDao.findWeekBySemesterId(semesterId);
    }

    public int setSemeter(Semester semester){
        return weektableDao.setSemeter(semester);
    }

    public int setWeek(Weektable weektable){
        return weektableDao.setWeektable(weektable);
    }

    public void deleteWeeksBySid(String semesterId){
        weektableDao.deleteWeeksBySid(semesterId);
    }

    public void deleteSemester(String semesterId){
        weektableDao.deleteSemester(semesterId);
    }
}
